<template>
	<view class="top">
		<image @click="backPage" class="back-icon" src="../../static/image/top-back/back.png"></image>
		<view class="top-title">
			<view class="title-content">{{titleContent}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		props: {
			titleContent: {
				type: String,
				default: "hahah"
			}
		},
		methods:{
			backPage(){
				this.$emit("backPage");
			}
		}
	}
</script>

<style lang="scss">
	.top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		/* 将子元素平均分布在父元素中 */
		height: 80rpx;
		background-color: #4f4f4f;

		.back-icon {
			margin-left: 10rpx;
			width: 50rpx;
			height: 40rpx;
		}

		.top-title {
			color: #ffb612;
			/* 增加这行代码，使.title占用剩余空间 */
			flex: 1;

			.title-content {
				/* 水平居中 */
				text-align: center;
				margin-right: 30rpx;
			}

		}
	}
</style>